package com.heima.search.controller.v1;

import com.heima.api.search.ApAssociateWordsControllerApi;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.search.dtos.UserSearchDto;
import com.heima.search.service.ApAssociateWordsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author awei
 * @Description 联想词表 前端控制器
 */
@Slf4j
@RestController
@RequestMapping("/api/v2/associate")
public class ApAssociateWordsController implements ApAssociateWordsControllerApi {
    @Resource
    private ApAssociateWordsService apAssociateWordsService;

    @PostMapping("/search")
    @Override
    public ResponseResult findAssociate(@RequestBody UserSearchDto userSearchDto) {
//        return apAssociateWordsService.findAssociate(userSearchDto);
        return apAssociateWordsService.findAssociateV2(userSearchDto);
    }


}